package hjt.com.module_test.activity;

import androidx.databinding.DataBindingUtil;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.alibaba.android.arouter.facade.annotation.Route;

import hjt.com.componentbase.constant.ARouterConstants;
import hjt.com.module_test.R;
import hjt.com.module_test.model.User;
import hjt.com.module_test.databinding.ActivityMvvmBinding;

@Route(path = ARouterConstants.ACTIVITY_TEST_MVVM)
public class MvvmActivity extends AppCompatActivity {

    private User user;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityMvvmBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_mvvm);
        user = new User();
        binding.setUser(user);
        user.setName("ldafdasf");
    }

    public void clickName(View view) {
        user.setName("比高加索四");
    }

    public void changeAge(View view) {
        user.setAge(1221);
        user.setImgUrl("https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=4138850978,2612460506&fm=200&gp=0.jpg");
    }
}
